<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            display: flex;
        }
        
        img {
            width: 80px;
            /* vertical-align: top; */
            margin-left: 5px;
        }
        
        span {
            cursor: default;
        }
    </style>
</head>

<body>
    <div id="box">
        <span class="close">X</span>
        <img src="images/tao.png" alt="" srcset="">
    </div>
    <script>
        var close = document.getElementsByClassName('close')[0]
        var box = document.querySelector('#box')
        close.onclick = function() {
            console.log("click me.");
            box.style.display = 'none'
        }
    </script>
</body>

</html>